package com.aipanda.pojo;

import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @param  -----------基本设置-----------
 * @param  siteName 					网站名称
 * @param  siteUrl 						网站网址
 * @param  logo	logo
 * @param  hotSearch  					热门搜索
 * @param  address						联系地址
 * @param  phone						联系电话
 * @param  zipCode						邮政编码
 * @param  email  
 * @param  certtext						备案编号
 * @param  isSiteEnabled				是否网站开启
 * @param  siteCloseMessage				网站关闭消息
 * @param  -----------显示设置-----------
 * @param  largeProductImageWidth		商品图片(大)宽度
 * @param  largeProductImageHeight		商品图片(大)高度
 * @param  mediumProductImageWidth  	商品图片(中)宽度 
 * @param  mediumProductImageHeight		商品图片(中) 高度  
 * @param  thumbnailProductImageWidth	商品图片(缩略)宽度
 * @param  thumbnailProductImageHeight  商品图片(缩略) 高度
 * @param  defaultLargeProductImage   	默认商品图片(大)
 * @param  defaultMediumProductImage	默认商品图片(中)
 * @param  defaultThumbnailProductImage	默认商品图片(缩略)
 * @param  watermarkAlpha   			水印透明度
 * @param  watermarkImage				水印图片
 * @param  atermarkPosition				水印位置
 * @param  priceScale					价格精确位数
 * @param  priceRoundType				价格精确方式
 * @param  isShowMarketPrice			是否前台显示市场价
 * @param  defaultMarketPriceScale		默认市场价换算比例
 * @param  -----------注册与安全-----------
 * @param  isRegisterEnabled			是否开放注册
 * @param  isDuplicateEmail				是否允许E-mail重复注册
 * @param  disabledUsername				禁用用户名
 * @param  usernameMinLength			用户名最小长度
 * @param  usernameMaxLength			用户名最大长度
 * @param  passwordMinLength			密码最小长度
 * @param  passwordMaxLength			密码最大长度
 * @param  registerPoint				注册初始积分
 * @param  registerAgreement			注册协议
 * @param  isEmailLogin					是否允许E-mail登录
 * @param  captchaTypes					验证码类型
 * @param  accountLockTypes				账号锁定类型
 * @param  accountLockCount				连续登录失败最大次数
 * @param  accountLockTime				自动解锁时间
 * @param  safeKeyExpiryTime			安全密匙有效时间
 * @param  uploadMaxSize				上传文件最大限制
 * @param  uploadImageExtension			允许上传图片扩展名
 * @param  uploadFlashExtension			允许上传Flash扩展名
 * @param  uploadMediaExtension			允许上传媒体扩展名
 * @param  uploadFileExtension			允许上传文件扩展名
 * @param  imageUploadPath				图片上传路径
 * @param  flashUploadPath				Flash上传路径
 * @param  mediaUploadPath				媒体上传路径
 * @param  fileUploadPath				文件上传路径
 * @param  -----------邮件设置----------- 
 * @param  smtpFromMail					发件人邮箱
 * @param  smtpHostSMTP					服务器地址
 * @param  smtpPortSMTP					服务器端口
 * @param  smtpUsername					SMTP用户名
 * @param  smtpPassword					SMTP密码
 * @param  -----------其他设置-----------
 * @param  currencySign					货币符号
 * @param  currencyUnit					货币单位
 * @param  stockAlertCount				库存警告数
 * @param  stockAllocationTime			库存分配时间点
 * @param  defaultPointScale			默认积分换算比例
 * @param  isDevelopmentEnabled			是否开启开发模式
 * @param  isReviewEnabled				是否开启评论
 * @param  isReviewCheck				是否审核评论
 * @param  reviewAuthority				评论权限
 * @param  isConsultationEnabled		是否开启咨询
 * @param  isConsultationCheck			是否审核咨询
 * @param  consultationAuthority		咨询权限
 * @param  isInvoiceEnabled				是否开启发票功能
 * @param  isTaxPriceEnabled			是否开启含税价
 * @param  taxRate						税率
 * @param  cookiePath					Cookie路径
 * @param  cookieDomain					Cookie作用域
 * @param  kuaidi100Key					快递100授权KEY
 * @param  -----------siteMap管理---------
 * @param  isCnzzEnabled   				是否启用CNZZ
 * @param  cnzzSiteId   				站点ID
 * @param  cnzzPassword  				站点密码
 * 
 * @author wanyuxiang
 *
 */
public class Setting implements Serializable {
	private static final long serialVersionUID = -1478999889661796840L;
	public static final String CACHE_NAME = "setting";
	public static final Integer CACHE_KEY = 0;
	private String siteName;
	private String siteUrl;
	private String logo;
	private String hotSearch;
	private String address;
	private String phone;
	private String zipCode;
	private String email;
	private String certtext;
	private Boolean isSiteEnabled;
	private String siteCloseMessage;
	private Integer largeProductImageWidth;
	private Integer largeProductImageHeight;
	private Integer mediumProductImageWidth;
	private Integer mediumProductImageHeight;
	private Integer thumbnailProductImageWidth;
	private Integer thumbnailProductImageHeight;
	private String defaultLargeProductImage;
	private String defaultMediumProductImage;
	private String defaultThumbnailProductImage;
	private Integer watermarkAlpha;
	private String watermarkImage;
	private WatermarkPosition watermarkPosition;
	private Integer priceScale;
	private RoundType priceRoundType;
	private Boolean isShowMarketPrice;
	private Double defaultMarketPriceScale;
	private Boolean isRegisterEnabled;
	private Boolean isDuplicateEmail;
	private String disabledUsername;
	private Integer usernameMinLength;
	private Integer usernameMaxLength;
	private Integer passwordMinLength;
	private Integer passwordMaxLength;
	private Long registerPoint;
	private String registerAgreement;
	private Boolean isEmailLogin;
	private CaptchaType[] captchaTypes;
	private AccountLockType[] accountLockTypes;
	private Integer accountLockCount;
	private Integer accountLockTime;
	private Integer safeKeyExpiryTime;
	private Integer uploadMaxSize;
	private String uploadImageExtension;
	private String uploadFlashExtension;
	private String uploadMediaExtension;
	private String uploadFileExtension;
	private String imageUploadPath;
	private String flashUploadPath;
	private String mediaUploadPath;
	private String fileUploadPath;
	private String smtpFromMail;
	private String smtpHost;
	private Integer smtpPort;
	private String smtpUsername;
	private String smtpPassword;
	private String currencySign;
	private String currencyUnit;
	private Integer stockAlertCount;
	private StockAllocationTime stockAllocationTime;
	private Double defaultPointScale;
	private Boolean isDevelopmentEnabled;
	private Boolean isReviewEnabled;
	private Boolean isReviewCheck;
	private ReviewAuthority reviewAuthority;
	private Boolean isConsultationEnabled;
	private Boolean isConsultationCheck;
	private ConsultationAuthority consultationAuthority;
	private Boolean isInvoiceEnabled;
	private Boolean isTaxPriceEnabled;
	private Double taxRate;
	private String cookiePath;
	private String cookieDomain;
	private String kuaidi100Key;
	private Boolean isCnzzEnabled;
	private String cnzzSiteId;
	private String cnzzPassword;

	@NotEmpty
	@Length(max = 255)
	public String getSiteName() {
		return this.siteName;
	}

	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}

	@NotEmpty
	@Length(max = 255)
	public String getSiteUrl() {
		return this.siteUrl;
	}

	public void setSiteUrl(String siteUrl) {
		this.siteUrl = StringUtils.removeEnd(siteUrl, "/");
	}

	@NotEmpty
	@Length(max = 255)
	public String getLogo() {
		return this.logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	@Length(max = 255)
	public String getHotSearch() {
		return this.hotSearch;
	}

	public void setHotSearch(String hotSearch) {
		if (hotSearch != null) {
			hotSearch = hotSearch.replaceAll("[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "");
		}
		this.hotSearch = hotSearch;
	}

	@Length(max = 255)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Length(max = 255)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Length(max = 255)
	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Email
	@Length(max = 255)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Length(max = 255)
	public String getCerttext() {
		return this.certtext;
	}

	public void setCerttext(String certtext) {
		this.certtext = certtext;
	}

	@NotNull
	public Boolean getIsSiteEnabled() {
		return this.isSiteEnabled;
	}

	public void setIsSiteEnabled(Boolean isSiteEnabled) {
		this.isSiteEnabled = isSiteEnabled;
	}

	@NotEmpty
	public String getSiteCloseMessage() {
		return this.siteCloseMessage;
	}

	public void setSiteCloseMessage(String siteCloseMessage) {
		this.siteCloseMessage = siteCloseMessage;
	}

	@NotNull
	@Min(1L)
	public Integer getLargeProductImageWidth() {
		return this.largeProductImageWidth;
	}

	public void setLargeProductImageWidth(Integer largeProductImageWidth) {
		this.largeProductImageWidth = largeProductImageWidth;
	}

	@NotNull
	@Min(1L)
	public Integer getLargeProductImageHeight() {
		return this.largeProductImageHeight;
	}

	public void setLargeProductImageHeight(Integer largeProductImageHeight) {
		this.largeProductImageHeight = largeProductImageHeight;
	}

	@NotNull
	@Min(1L)
	public Integer getMediumProductImageWidth() {
		return this.mediumProductImageWidth;
	}

	public void setMediumProductImageWidth(Integer mediumProductImageWidth) {
		this.mediumProductImageWidth = mediumProductImageWidth;
	}

	@NotNull
	@Min(1L)
	public Integer getMediumProductImageHeight() {
		return this.mediumProductImageHeight;
	}

	public void setMediumProductImageHeight(Integer mediumProductImageHeight) {
		this.mediumProductImageHeight = mediumProductImageHeight;
	}

	@NotNull
	@Min(1L)
	public Integer getThumbnailProductImageWidth() {
		return this.thumbnailProductImageWidth;
	}

	public void setThumbnailProductImageWidth(Integer thumbnailProductImageWidth) {
		this.thumbnailProductImageWidth = thumbnailProductImageWidth;
	}

	@NotNull
	@Min(1L)
	public Integer getThumbnailProductImageHeight() {
		return this.thumbnailProductImageHeight;
	}

	public void setThumbnailProductImageHeight(
			Integer thumbnailProductImageHeight) {
		this.thumbnailProductImageHeight = thumbnailProductImageHeight;
	}

	@NotEmpty
	@Length(max = 255)
	public String getDefaultLargeProductImage() {
		return this.defaultLargeProductImage;
	}

	public void setDefaultLargeProductImage(String defaultLargeProductImage) {
		this.defaultLargeProductImage = defaultLargeProductImage;
	}

	@NotEmpty
	@Length(max = 255)
	public String getDefaultMediumProductImage() {
		return this.defaultMediumProductImage;
	}

	public void setDefaultMediumProductImage(String defaultMediumProductImage) {
		this.defaultMediumProductImage = defaultMediumProductImage;
	}

	@NotEmpty
	@Length(max = 255)
	public String getDefaultThumbnailProductImage() {
		return this.defaultThumbnailProductImage;
	}

	public void setDefaultThumbnailProductImage(
			String defaultThumbnailProductImage) {
		this.defaultThumbnailProductImage = defaultThumbnailProductImage;
	}

	@NotNull
	@Min(0L)
	@Max(100L)
	public Integer getWatermarkAlpha() {
		return this.watermarkAlpha;
	}

	public void setWatermarkAlpha(Integer watermarkAlpha) {
		this.watermarkAlpha = watermarkAlpha;
	}

	public String getWatermarkImage() {
		return this.watermarkImage;
	}

	public void setWatermarkImage(String watermarkImage) {
		this.watermarkImage = watermarkImage;
	}

	@NotNull
	public WatermarkPosition getWatermarkPosition() {
		return this.watermarkPosition;
	}

	public void setWatermarkPosition(WatermarkPosition watermarkPosition) {
		this.watermarkPosition = watermarkPosition;
	}

	@NotNull
	@Min(0L)
	@Max(3L)
	public Integer getPriceScale() {
		return this.priceScale;
	}

	public void setPriceScale(Integer priceScale) {
		this.priceScale = priceScale;
	}

	@NotNull
	public RoundType getPriceRoundType() {
		return this.priceRoundType;
	}

	public void setPriceRoundType(RoundType priceRoundType) {
		this.priceRoundType = priceRoundType;
	}

	@NotNull
	public Boolean getIsShowMarketPrice() {
		return this.isShowMarketPrice;
	}

	public void setIsShowMarketPrice(Boolean isShowMarketPrice) {
		this.isShowMarketPrice = isShowMarketPrice;
	}

	@NotNull
	@Min(0L)
	@Digits(integer = 3, fraction = 3)
	public Double getDefaultMarketPriceScale() {
		return this.defaultMarketPriceScale;
	}

	public void setDefaultMarketPriceScale(Double defaultMarketPriceScale) {
		this.defaultMarketPriceScale = defaultMarketPriceScale;
	}

	@NotNull
	public Boolean getIsRegisterEnabled() {
		return this.isRegisterEnabled;
	}

	public void setIsRegisterEnabled(Boolean isRegisterEnabled) {
		this.isRegisterEnabled = isRegisterEnabled;
	}

	@NotNull
	public Boolean getIsDuplicateEmail() {
		return this.isDuplicateEmail;
	}

	public void setIsDuplicateEmail(Boolean isDuplicateEmail) {
		this.isDuplicateEmail = isDuplicateEmail;
	}

	@Length(max = 255)
	public String getDisabledUsername() {
		return this.disabledUsername;
	}

	public void setDisabledUsername(String disabledUsername) {
		if (disabledUsername != null) {
			disabledUsername = disabledUsername.replaceAll("[,\\s]*,[,\\s]*",
					",").replaceAll("^,|,$", "");
		}
		this.disabledUsername = disabledUsername;
	}

	@NotNull
	@Min(1L)
	@Max(117L)
	public Integer getUsernameMinLength() {
		return this.usernameMinLength;
	}

	public void setUsernameMinLength(Integer usernameMinLength) {
		this.usernameMinLength = usernameMinLength;
	}

	@NotNull
	@Min(1L)
	@Max(117L)
	public Integer getUsernameMaxLength() {
		return this.usernameMaxLength;
	}

	public void setUsernameMaxLength(Integer usernameMaxLength) {
		this.usernameMaxLength = usernameMaxLength;
	}

	@NotNull
	@Min(1L)
	@Max(117L)
	public Integer getPasswordMinLength() {
		return this.passwordMinLength;
	}

	public void setPasswordMinLength(Integer passwordMinLength) {
		this.passwordMinLength = passwordMinLength;
	}

	@NotNull
	@Min(1L)
	@Max(117L)
	public Integer getPasswordMaxLength() {
		return this.passwordMaxLength;
	}

	public void setPasswordMaxLength(Integer passwordMaxLength) {
		this.passwordMaxLength = passwordMaxLength;
	}

	@NotNull
	@Min(0L)
	public Long getRegisterPoint() {
		return this.registerPoint;
	}

	public void setRegisterPoint(Long registerPoint) {
		this.registerPoint = registerPoint;
	}

	@NotEmpty
	public String getRegisterAgreement() {
		return this.registerAgreement;
	}

	public void setRegisterAgreement(String registerAgreement) {
		this.registerAgreement = registerAgreement;
	}

	@NotNull
	public Boolean getIsEmailLogin() {
		return this.isEmailLogin;
	}

	public void setIsEmailLogin(Boolean isEmailLogin) {
		this.isEmailLogin = isEmailLogin;
	}

	public CaptchaType[] getCaptchaTypes() {
		return this.captchaTypes;
	}

	public void setCaptchaTypes(CaptchaType[] captchaTypes) {
		this.captchaTypes = captchaTypes;
	}

	public AccountLockType[] getAccountLockTypes() {
		return this.accountLockTypes;
	}

	public void setAccountLockTypes(AccountLockType[] accountLockTypes) {
		this.accountLockTypes = accountLockTypes;
	}

	@NotNull
	@Min(1L)
	public Integer getAccountLockCount() {
		return this.accountLockCount;
	}

	public void setAccountLockCount(Integer accountLockCount) {
		this.accountLockCount = accountLockCount;
	}

	@NotNull
	@Min(0L)
	public Integer getAccountLockTime() {
		return this.accountLockTime;
	}

	public void setAccountLockTime(Integer accountLockTime) {
		this.accountLockTime = accountLockTime;
	}

	@NotNull
	@Min(0L)
	public Integer getSafeKeyExpiryTime() {
		return this.safeKeyExpiryTime;
	}

	public void setSafeKeyExpiryTime(Integer safeKeyExpiryTime) {
		this.safeKeyExpiryTime = safeKeyExpiryTime;
	}

	@NotNull
	@Min(0L)
	public Integer getUploadMaxSize() {
		return this.uploadMaxSize;
	}

	public void setUploadMaxSize(Integer uploadMaxSize) {
		this.uploadMaxSize = uploadMaxSize;
	}

	@Length(max = 255)
	public String getUploadImageExtension() {
		return this.uploadImageExtension;
	}

	public void setUploadImageExtension(String uploadImageExtension) {
		if (uploadImageExtension != null) {
			uploadImageExtension = uploadImageExtension.replaceAll(
					"[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "")
					.toLowerCase();
		}
		this.uploadImageExtension = uploadImageExtension;
	}

	@Length(max = 255)
	public String getUploadFlashExtension() {
		return this.uploadFlashExtension;
	}

	public void setUploadFlashExtension(String uploadFlashExtension) {
		if (uploadFlashExtension != null) {
			uploadFlashExtension = uploadFlashExtension.replaceAll(
					"[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "")
					.toLowerCase();
		}
		this.uploadFlashExtension = uploadFlashExtension;
	}

	@Length(max = 255)
	public String getUploadMediaExtension() {
		return this.uploadMediaExtension;
	}

	public void setUploadMediaExtension(String uploadMediaExtension) {
		if (uploadMediaExtension != null) {
			uploadMediaExtension = uploadMediaExtension.replaceAll(
					"[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "")
					.toLowerCase();
		}
		this.uploadMediaExtension = uploadMediaExtension;
	}

	@Length(max = 255)
	public String getUploadFileExtension() {
		return this.uploadFileExtension;
	}

	public void setUploadFileExtension(String uploadFileExtension) {
		if (uploadFileExtension != null) {
			uploadFileExtension = uploadFileExtension.replaceAll(
					"[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "")
					.toLowerCase();
		}
		this.uploadFileExtension = uploadFileExtension;
	}

	@NotEmpty
	@Length(max = 255)
	public String getImageUploadPath() {
		return this.imageUploadPath;
	}

	public void setImageUploadPath(String imageUploadPath) {
		if (imageUploadPath != null) {
			if (!imageUploadPath.startsWith("/")) {
				imageUploadPath = "/" + imageUploadPath;
			}
			if (!imageUploadPath.endsWith("/")) {
				imageUploadPath = imageUploadPath + "/";
			}
		}
		this.imageUploadPath = imageUploadPath;
	}

	@NotEmpty
	@Length(max = 255)
	public String getFlashUploadPath() {
		return this.flashUploadPath;
	}

	public void setFlashUploadPath(String flashUploadPath) {
		if (flashUploadPath != null) {
			if (!flashUploadPath.startsWith("/")) {
				flashUploadPath = "/" + flashUploadPath;
			}
			if (!flashUploadPath.endsWith("/")) {
				flashUploadPath = flashUploadPath + "/";
			}
		}
		this.flashUploadPath = flashUploadPath;
	}

	@NotEmpty
	@Length(max = 255)
	public String getMediaUploadPath() {
		return this.mediaUploadPath;
	}

	public void setMediaUploadPath(String mediaUploadPath) {
		if (mediaUploadPath != null) {
			if (!mediaUploadPath.startsWith("/")) {
				mediaUploadPath = "/" + mediaUploadPath;
			}
			if (!mediaUploadPath.endsWith("/")) {
				mediaUploadPath = mediaUploadPath + "/";
			}
		}
		this.mediaUploadPath = mediaUploadPath;
	}

	@NotEmpty
	@Length(max = 255)
	public String getFileUploadPath() {
		return this.fileUploadPath;
	}

	public void setFileUploadPath(String fileUploadPath) {
		if (fileUploadPath != null) {
			if (!fileUploadPath.startsWith("/")) {
				fileUploadPath = "/" + fileUploadPath;
			}
			if (!fileUploadPath.endsWith("/")) {
				fileUploadPath = fileUploadPath + "/";
			}
		}
		this.fileUploadPath = fileUploadPath;
	}

	@NotEmpty
	@Email
	@Length(max = 255)
	public String getSmtpFromMail() {
		return this.smtpFromMail;
	}

	public void setSmtpFromMail(String smtpFromMail) {
		this.smtpFromMail = smtpFromMail;
	}

	@NotEmpty
	@Length(max = 255)
	public String getSmtpHost() {
		return this.smtpHost;
	}

	public void setSmtpHost(String smtpHost) {
		this.smtpHost = smtpHost;
	}

	@NotNull
	@Min(0L)
	public Integer getSmtpPort() {
		return this.smtpPort;
	}

	public void setSmtpPort(Integer smtpPort) {
		this.smtpPort = smtpPort;
	}

	@NotEmpty
	@Length(max = 255)
	public String getSmtpUsername() {
		return this.smtpUsername;
	}

	public void setSmtpUsername(String smtpUsername) {
		this.smtpUsername = smtpUsername;
	}

	@Length(max = 255)
	public String getSmtpPassword() {
		return this.smtpPassword;
	}

	public void setSmtpPassword(String smtpPassword) {
		this.smtpPassword = smtpPassword;
	}

	@NotEmpty
	@Length(max = 255)
	public String getCurrencySign() {
		return this.currencySign;
	}

	public void setCurrencySign(String currencySign) {
		this.currencySign = currencySign;
	}

	@NotEmpty
	@Length(max = 255)
	public String getCurrencyUnit() {
		return this.currencyUnit;
	}

	public void setCurrencyUnit(String currencyUnit) {
		this.currencyUnit = currencyUnit;
	}

	@NotNull
	@Min(0L)
	public Integer getStockAlertCount() {
		return this.stockAlertCount;
	}

	public void setStockAlertCount(Integer stockAlertCount) {
		this.stockAlertCount = stockAlertCount;
	}

	@NotNull
	public StockAllocationTime getStockAllocationTime() {
		return this.stockAllocationTime;
	}

	public void setStockAllocationTime(StockAllocationTime stockAllocationTime) {
		this.stockAllocationTime = stockAllocationTime;
	}

	@NotNull
	@Min(0L)
	@Digits(integer = 3, fraction = 3)
	public Double getDefaultPointScale() {
		return this.defaultPointScale;
	}

	public void setDefaultPointScale(Double defaultPointScale) {
		this.defaultPointScale = defaultPointScale;
	}

	@NotNull
	public Boolean getIsDevelopmentEnabled() {
		return this.isDevelopmentEnabled;
	}

	public void setIsDevelopmentEnabled(Boolean isDevelopmentEnabled) {
		this.isDevelopmentEnabled = isDevelopmentEnabled;
	}

	@NotNull
	public Boolean getIsReviewEnabled() {
		return this.isReviewEnabled;
	}

	public void setIsReviewEnabled(Boolean isReviewEnabled) {
		this.isReviewEnabled = isReviewEnabled;
	}

	@NotNull
	public Boolean getIsReviewCheck() {
		return this.isReviewCheck;
	}

	public void setIsReviewCheck(Boolean isReviewCheck) {
		this.isReviewCheck = isReviewCheck;
	}

	@NotNull
	public ReviewAuthority getReviewAuthority() {
		return this.reviewAuthority;
	}

	public void setReviewAuthority(ReviewAuthority reviewAuthority) {
		this.reviewAuthority = reviewAuthority;
	}

	@NotNull
	public Boolean getIsConsultationEnabled() {
		return this.isConsultationEnabled;
	}

	public void setIsConsultationEnabled(Boolean isConsultationEnabled) {
		this.isConsultationEnabled = isConsultationEnabled;
	}

	@NotNull
	public Boolean getIsConsultationCheck() {
		return this.isConsultationCheck;
	}

	public void setIsConsultationCheck(Boolean isConsultationCheck) {
		this.isConsultationCheck = isConsultationCheck;
	}

	@NotNull
	public ConsultationAuthority getConsultationAuthority() {
		return this.consultationAuthority;
	}

	public void setConsultationAuthority(
			ConsultationAuthority consultationAuthority) {
		this.consultationAuthority = consultationAuthority;
	}

	@NotNull
	public Boolean getIsInvoiceEnabled() {
		return this.isInvoiceEnabled;
	}

	public void setIsInvoiceEnabled(Boolean isInvoiceEnabled) {
		this.isInvoiceEnabled = isInvoiceEnabled;
	}

	@NotNull
	public Boolean getIsTaxPriceEnabled() {
		return this.isTaxPriceEnabled;
	}

	public void setIsTaxPriceEnabled(Boolean isTaxPriceEnabled) {
		this.isTaxPriceEnabled = isTaxPriceEnabled;
	}

	@NotNull
	@Min(0L)
	@Digits(integer = 3, fraction = 3)
	public Double getTaxRate() {
		return this.taxRate;
	}

	public void setTaxRate(Double taxRate) {
		this.taxRate = taxRate;
	}

	@NotEmpty
	@Length(max = 255)
	public String getCookiePath() {
		return this.cookiePath;
	}

	public void setCookiePath(String cookiePath) {
		if ((cookiePath != null) && (!cookiePath.endsWith("/"))) {
			cookiePath = cookiePath + "/";
		}
		this.cookiePath = cookiePath;
	}

	@Length(max = 255)
	public String getCookieDomain() {
		return this.cookieDomain;
	}

	public void setCookieDomain(String cookieDomain) {
		this.cookieDomain = cookieDomain;
	}

	@Length(max = 255)
	public String getKuaidi100Key() {
		return this.kuaidi100Key;
	}

	public void setKuaidi100Key(String kuaidi100Key) {
		this.kuaidi100Key = kuaidi100Key;
	}

	public Boolean getIsCnzzEnabled() {
		return this.isCnzzEnabled;
	}

	public void setIsCnzzEnabled(Boolean isCnzzEnabled) {
		this.isCnzzEnabled = isCnzzEnabled;
	}

	public String getCnzzSiteId() {
		return this.cnzzSiteId;
	}

	public void setCnzzSiteId(String cnzzSiteId) {
		this.cnzzSiteId = cnzzSiteId;
	}

	public String getCnzzPassword() {
		return this.cnzzPassword;
	}

	public void setCnzzPassword(String cnzzPassword) {
		this.cnzzPassword = cnzzPassword;
	}

	public String[] getHotSearches() {
		return StringUtils.split(this.hotSearch, ",");
	}

	public String[] getDisabledUsernames() {
		return StringUtils.split(this.disabledUsername, ",");
	}

	public String[] getUploadImageExtensions() {
		return StringUtils.split(this.uploadImageExtension, ",");
	}

	public String[] getUploadFlashExtensions() {
		return StringUtils.split(this.uploadFlashExtension, ",");
	}

	public String[] getUploadMediaExtensions() {
		return StringUtils.split(this.uploadMediaExtension, ",");
	}

	public String[] getUploadFileExtensions() {
		return StringUtils.split(this.uploadFileExtension, ",");
	}
	
	/**
	 * 返回传递金额的小数点后2位
	 * @param amount
	 * @return
	 */
	public BigDecimal setPriceScale(BigDecimal amount) {
		if (amount == null) {
			return null;
		}
		int roundingMode;
		if (getPriceRoundType() == RoundType.roundUp) {
			roundingMode = 0;
		} else {
			if (getPriceRoundType() == RoundType.roundDown) {
				roundingMode = 1;
			} else {
				roundingMode = 4;
			}
		}
		return amount.setScale(getPriceScale(), roundingMode);
	}

	public static enum AccountLockType {
		member, admin;
	}

	/**
	 * @param 	memberLogin		会员登录
	 * @param 	memberRegister	会员注册
	 * @param 	adminLogin		后台登录
	 * @param 	review			商品评论
	 * @param 	consultation	商品咨询	
	 * @param 	findPassword	找回密码
	 * @param	resetPassword	重置密码
	 * @param 	other			其它
	 * @author wanyuxiang
	 *
	 */
	public static enum CaptchaType {
		memberLogin, 
		memberRegister, 
		adminLogin, 
		review, 
		consultation, 
		findPassword, 
		resetPassword, 
		other;
	}

	public static enum ConsultationAuthority {
		anyone,

		member;
	}

	public static enum ReviewAuthority {
		anyone,

		member,

		purchased;
	}

	/**
	 * @param roundHalfUp	四舍五入
	 * @param roundUp		向下取整
	 * @param roundDown		向下取整
	 * @author wanyuxiang
	 *
	 */
	public static enum RoundType {
		roundHalfUp,
		roundUp,
		roundDown;
	}

	public static enum StockAllocationTime {
		order,

		payment,

		ship;
	}

	/**
	 * @param no			无
	 * @param topLeft		左上
	 * @param topRight		右上
	 * @param center		居中
	 * @param bottomLeft	左下
	 * @param bottomRight   右下
	 * @author wanyuxiang
	 *
	 */
	public static enum WatermarkPosition {
		no,
		topLeft,
		topRight,
		center,
		bottomLeft,
		bottomRight;
	}
}
